home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 43 / Mac Magazin and MacEasy Magazine CD - Issue 43.iso / Software / Multimedia / Sound / PlayerPRO 4.6 Dev.Kit / MADH Library 4.6 / Libraries & Headers / RDriver.h < prev    next >
Encoding:
Text File  |  1998-02-12  |  19.6 KB  |  564 lines  |  [TEXT/CWIE]

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 4.5x -- MAD Music Driver Definition -
  4. //
  5. //    Library Version 4.5
  6. //
  7. //    To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    Thank you for your interest in PlayerPRO !
  15. //
  16. //    FAX:            (+41 22) 346 11 97
  17. //    PHONE:             (+41 79) 203 74 62
  18. //    Internet:         rosset@dial.eunet.ch or RossetAntoine@bluewin.ch
  19. //
  20. /********************                        ***********************/
  21.  
  22. #ifndef __RDRIVERH__
  23. #define __RDRIVERH__
  24.  
  25. #ifndef __MADH__
  26. #include "MAD.h"
  27. #endif
  28.  
  29. ////////////////////////////////////////////////
  30.  
  31. #ifdef _MAC_H
  32. #ifndef __SOUND__
  33. #include <Sound.h>
  34. #endif
  35.  
  36. #ifndef __RETRACE__
  37. #include <Retrace.h>
  38. #endif
  39. #endif
  40.  
  41. ////////////////////////////////////////////////
  42.  
  43. #ifdef _INTEL_H
  44. //static void debugger( char*a){MessageBox( GetForegroundWindow(), a, "PP", MB_OK | MB_ICONEXCLAMATION);}
  45.  
  46. #ifndef __DSOUND_INCLUDED__
  47. #include <mmreg.h>
  48. #include <DSound.h>
  49. #endif
  50. #endif
  51.  
  52. ////////////////////////////////////////////////
  53.  
  54. #if defined(powerc) || defined (__powerc)
  55. #pragma options align=mac68k
  56. #else
  57. #if !defined(THINK_C)
  58. #pragma options align=mac68k
  59. #endif
  60. #endif
  61.  
  62. ////////////////////////////////////////////////
  63.  
  64. /********************                        ***********************/
  65. /***                         Define List                            ***/
  66. /********************                        ***********************/
  67.  
  68. #define NUMBER_NOTES        96
  69. #define NOFINETUNE            8363
  70. #define MIN_VOLUME            0
  71. #define MAX_VOLUME            64
  72. #define MAXTRACK            32
  73. #define MAXINSTRU            64
  74. #define    MAXSAMPLE            25
  75. #define MAXPATTERN            200
  76. #define MAXPATTERNSIZE        900
  77. #define MAX_ARP             3
  78. #define MAXPLUG                40
  79. /********************                        ***********************/
  80. /***                         Error messages                         ***/
  81. /********************                        ***********************/
  82.  
  83. enum
  84. {
  85.     MADNeedMemory                     = -1,
  86.     MADReadingErr                    = -2,
  87.     MADIncompatibleFile                = -3,
  88.     MADLibraryNotInitialized        = -4,
  89.     MADParametersErr                = -5,
  90.     MADUnknowErr                    = -6,
  91.     MADSoundManagerErr                = -7,
  92.     MADOrderNotImplemented            = -8,
  93.     MADFileNotSupportedByThisPlug    = -9,
  94.     MADCannotFindPlug                = -10,
  95.     MADMusicHasNoDriver                = -11,
  96.     MADDriverHasNoMusic                = -12
  97. };
  98.  
  99. /********************                        ***********************/
  100. /***                Channel structure definition                    ***/
  101. /********************                        ***********************/
  102.  
  103. struct Channel
  104. {
  105.         long        ID;                    // Channel ID - 0 to 31
  106.  
  107.         Ptr            begPtr;                // Sample Data Ptr - Beginning of data
  108.         Ptr            maxPtr;                // Sample Data Ptr - End of data
  109.         Ptr            curPtr;                // Sample Data Ptr - Current position
  110.         long        sizePtr;            // Sample Size in bytes
  111.         
  112.         long        amp;                // Sample amplitude: 8 or 16 bits
  113.         
  114.         long        loopBeg;            // Loop Beginning
  115.         long        loopSize;            // Loop Size
  116.         
  117.         long        ins;                // Current Instrument ID
  118.         long        insOld;                // Previous Instrument ID played on this channel
  119.         long        samp;                // Current Sample ID
  120.         
  121.         long        fineTune;            // Finetune
  122.         
  123.         long        note;                // Note
  124.         long        noteOld;            // Previous note played on this channel
  125.         
  126.         long         period;                // Current period
  127.         long        periodOld;            // Previous period played on this channel
  128.         
  129.         long        vol;                // Channel vol (0 to 64)
  130.         long         cmd;                // Command
  131.         Byte        arg;                // Argument of command
  132.         Byte        volcmd;                // Volume Command
  133.         
  134.         long         arp[ MAX_ARP];        // Used for arpeggio command
  135.         long         arpindex;            // Used for arpeggio command
  136.         
  137.         long        viboffset;            // Used for vibrato command
  138.         long         vibdepth;            // Used for vibrato command
  139.         long         vibrate;            // Used for vibrato command
  140.         
  141.         long         slide;                // Used for slideUp and slideDown command
  142.         
  143.         long         pitchgoal;            // Used for portamento command
  144.         long         pitchrate;            // Used for portamento command
  145.         
  146.         long         volumerate;            // Used for slideVolume command
  147.         
  148.         long        oldArg[ 16];
  149.  
  150.         Ptr            samplePtr;            // Used internaly by MADPlaySoundData & MADPlaySndHandle
  151.         
  152.         /**/
  153.         
  154.         Boolean        KeyOn;
  155.         short        a;
  156.         short        b;
  157.         short        p;
  158.         long        volEnv;
  159.         long        volFade;
  160.         
  161.         long        lAC;
  162.         
  163.         Ptr            prevPtr;
  164.         long        lastWord, curLastWord;
  165.         long        curLevel;
  166.         
  167.         long        prevVol, curPrevVol;
  168.         
  169.         /**/
  170.         
  171.         Boolean        GEffect;
  172.         short        GPat, GReader;
  173. };
  174. typedef        struct Channel    Channel;
  175.  
  176. /********************                        ***********************/
  177. /***         Music description - used in Import/Export filter    ***/
  178. /********************                        ***********************/
  179.  
  180. struct    MADMusic
  181. {
  182.     MADSpec                    *header;                                // Music Header - See 'MAD.h'
  183.     PatData                    *partition[ MAXPATTERN];                // Patterns
  184.     sData                    *(sample[ MAXINSTRU][ MAXSAMPLE]);        // Instruments
  185.     Boolean                    musicUnderModification;                    // Tell the driver to NOT access music data
  186.     
  187. };
  188. typedef        struct MADMusic    MADMusic;
  189.  
  190. /********************                        ***********************/
  191. /***                  Driver Settings definition                    ***/
  192. /********************                        ***********************/
  193.  
  194. enum
  195. {
  196.     ASCSoundDriver = 1,                // MAC ONLY
  197.     AWACSoundDriver,                // MAC ONLY
  198.     MIDISoundDriver,                // MAC ONLY
  199.     SoundManagerDriver,                // MAC ONLY You should use only SoundManagerDriver for full compatibility !
  200.     QK25SoundDriver,                // MAC ONLY
  201.     DigiDesignSoundDriver,            // MAC ONLY
  202.     BeOSSoundDriver,                // BE ONLY when using with BeOS compatible systems ! - NOT FOR MAC
  203.     DirectSound95NT,                // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  204.     Wave95NT,                        // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  205.     NoHardwareDriver                // NO HARDWARE CONNECTION, will not produce any sound
  206. };
  207.  
  208. enum
  209. {
  210.     MonoOutPut = 1,
  211.     StereoOutPut,
  212.     DeluxeStereoOutPut,
  213.     PolyPhonic,                        // Do NOT use it ! Standard hardware doesn't support it !
  214.     MultiFiles                        // Do NOT use it ! Standard hardware doesn't support it !
  215. };
  216.  
  217. struct MADDriverSettings
  218. {
  219.     short                    numChn;                                // Active tracks from 2 to 32, automatically setup when a new music is loaded
  220.     short                    outPutBits;                            // 8 or 16 Bits
  221.     unsigned long            outPutRate;                            // Fixed number, by example : rate44khz, rate22050hz, rate22khz, rate11khz, rate11025hz
  222.     short                    outPutMode;                            // MonoOutPut, StereoOutPut or DeluxeStereoOutPut ?
  223.     short                    driverMode;                            // ASCSoundDriver, AWACSoundDriver, MIDISoundDriver or SoundManagerDriver
  224.     Boolean                    antiAliasing;                        // Use AntiAliasing filter ? true/false
  225.     Boolean                    repeatMusic;                        // If music finished, repeat it or stop.
  226.     Boolean                    sysMemory;                            // Allocate memory in Application Heap (false) or in System Heap (true)
  227.     Boolean                    Interpolation;                        // Sound Interpolation active? true/false
  228.     Boolean                    MicroDelay;                            // Micro delay active? Used only in DeluxeStereoOutPut outPutMode.
  229.     long                    MicroDelaySize;                        // Micro delay duration (in ms, max 1 sec = 1000 ms)
  230.     Boolean                    surround;                            // Surround effect active? true/false
  231.     Boolean                    Reverb;                                // Reverb effect active? true/false
  232.     long                    ReverbSize;                            // Reverb delay duration (in ms, min = 25 ms, max 1 sec = 1000 ms)
  233.     long                    ReverbStrength;                        // Reverb strength in % (0 <-> 70)
  234.     Boolean                    TickRemover;                        // Remove volume/sample/loop ticks.
  235. };
  236. typedef struct MADDriverSettings MADDriverSettings;
  237.  
  238. /******************************************************************/
  239. //******************* MUSICS IMPORT/EXPORT PLUGS  *****************/
  240. //
  241. //    Protocol Version 2.3
  242. //
  243. //    To use with PlayerPRO for CodeWarrior
  244. //
  245. //    Your main function have to be in this form:
  246. //    OSErr main(     OSType order,
  247. //                    Ptr AlienFileName,
  248. //                    MADMusic *MadFile,
  249. //                    PPInfoRec *info,
  250. //                    MADDriverSettings *DriverParam);
  251. //
  252. //    Actual plug have to support these orders:
  253. //
  254. //    order: 'TEST':    check the AlienFile to see if your Plug really supports it.
  255. //    order: 'IMPT':    convert the AlienFile into a MADMusic. You have to allocate MADMusic.
  256. //    order: 'INFO':    Fill PPInfoRec structure.
  257. //    order: 'EXPT':    Convert the MADMusic into AlienFile. You have to create the AlienFile.
  258. //                    Don't delete the MADMusic Structure after conversion !!
  259. //
  260. //    An IMPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO'
  261. //    An EXPORT plug have to support these orders: 'EXPT'
  262. //     An IMPORT/EXPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO', 'EXPT'
  263. //
  264. //    About Resources:
  265. //
  266. //    Your Plug should have: Creator: 'SNPL', Type: 'IMPL' - MAC ONLY
  267. //
  268. //    Your Plug have to have these resources - MAC ONLY:
  269. //
  270. //    - One segment CODE 1000 with 68k Code
  271. //    - One segment PPCC 1000 with PPC Code (OPTIONAL: if PlayerPRO in PPC cannot find it, it will use the CODE 1000 resource)
  272. //    - One STR# resource :
  273. //
  274. //        1 string: which kind of files your plug support (OSType value!!! 4 char) By example: 'STrk', '669 ', etc...
  275. //        2 string: what does your Plug: EXPL : only Export files, IMPL : only Import Files, EXIM : import AND export.
  276. //        3 string: string that will be used in Import and Export menu of PlayerPRO
  277. //        4 string: Copyright string of this plug.
  278. //
  279. /********************                        ***********************/
  280.  
  281. struct PPInfoRec
  282. {
  283.     char        internalFileName[ 60];
  284.     char        formatDescription[ 60];
  285.     
  286.     long        totalPatterns;
  287.     long        partitionLength;
  288.     
  289.     short        totalTracks;
  290.     short        totalInstruments;
  291.     
  292.     OSType        signature;
  293.     
  294.     long        fileSize;
  295.     
  296. };
  297. typedef struct PPInfoRec PPInfoRec;
  298.  
  299.  
  300. /********************                        ***********************/
  301. /***             Informations about Plugs: ThePlug[]                ***/
  302. /********************                        ***********************/
  303.  
  304. #ifdef _MAC_H
  305. struct PlugInfo
  306. {
  307.     Handle        IOPlug;                                            // Plug CODE
  308.     Str63        MenuName;                                        // Plug name
  309.     Str63        AuthorString;                                    // Plug author
  310.     FSSpec        file;                                            // Location of plug file
  311.     char        type[ 5];                                        // OSType of file support
  312.     OSType        mode;                                            // Mode support : Import +/ Export
  313.     Boolean        hasPPCCode;                                        // Is Plug FAT?
  314. };
  315. typedef struct PlugInfo PlugInfo;
  316. #endif
  317.  
  318. #ifdef _INTEL_H
  319. //#include "windows.h"
  320. typedef OSErr (*PLUGDLLFUNC) ( OSType , Ptr , MADMusic* , PPInfoRec *, MADDriverSettings *);
  321. struct PlugInfo
  322. {
  323.     HANDLE            hLibrary;
  324.     PLUGDLLFUNC        IOPlug;                                        // Plug CODE
  325.     char            MenuName[ 65];                                // Plug name
  326.     char            AuthorString[ 65];                            // Plug author
  327.     char            file[ 255];                                    // Location of plug file
  328.     char            type[ 5];                                    // OSType of file support
  329.     OSType            mode;                                        // Mode support : Import +/ Export
  330. };
  331. typedef struct PlugInfo PlugInfo;
  332. #endif
  333.  
  334. #ifdef _BE_H
  335. struct PlugInfo
  336. {
  337.     Handle            hLibrary;
  338.     Ptr                IOPlug;                                        // Plug CODE
  339.     char            MenuName[ 65];                                // Plug name
  340.     char            AuthorString[ 65];                            // Plug author
  341.     char            file[ 255];                                    // Location of plug file
  342.     char            type[ 5];                                    // OSType of file support
  343.     OSType            mode;                                        // Mode support : Import +/ Export
  344. };
  345. typedef struct PlugInfo PlugInfo;
  346. #endif
  347. /********************                        ***********************/
  348. /***         Global structure : PlayerPRO variables                ***/
  349. /********************                        ***********************/
  350.  
  351. #ifdef _MAC_H                        // For ASC support on 68k Macintoshes
  352. struct inVBLRec
  353. {
  354.     VBLTask            VBL;
  355.     long            VBLA5;
  356. };
  357. typedef struct inVBLRec inVBLRec;
  358. #endif
  359.  
  360. struct MADLibrary
  361. {
  362.     long                    IDType;                                // IDType = 'MADD' -- READ ONLY --
  363.     Boolean                    sysMemory;
  364.     long                    mytab[ 12];
  365.     
  366.     /** Plugs Import/Export variables **/
  367.     
  368.     PlugInfo                 *ThePlug;                            // Pointers on plugs code & infos
  369.     short                    TotalPlug;                            // no of Plugs in pointer ThePlug
  370.  
  371. };
  372. typedef struct MADLibrary MADLibrary;
  373.  
  374. struct MADDriverRec
  375. {
  376.     /**********************/
  377.     /** Public variables **/
  378.     /**********************/
  379.     
  380.     MADDriverSettings        DriverSettings;                                    // Driver SetUp -- READ ONLY --
  381.     
  382.     /**  Current music in memory, loaded with RLoadMusic() by example **/
  383.     
  384.     MADMusic                *curMusic;                                        // Current music played by this driver, it can be 0L !!!
  385.     MADLibrary                *lib;
  386.     
  387.     /**  Drivers variables **/
  388.     
  389.     Channel                    chan[ MAXTRACK];                                // Current driver channels -- READ ONLY --
  390.     Boolean                    musicEnd;                                        // Is music playing finished? -- READ ONLY --
  391.     short                    Tube[ MAXTRACK];                                // Used in 'Tracks View' Window - View menu 
  392.     short                    PartitionReader;                                // Current position in pattern (0...64)
  393.     short                    Pat;                                            // Current ID Pattern, see 'Patterns list'
  394.     short                    PL;                                                // Current position in partition, see 'Partition list'
  395.     long                    VolExt[ MAXTRACK];                                // Volumes settings for each track, see 'Adaptators' window. from 0 to 64
  396.     long                    VolGlobal;                                        // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
  397.     short                    speed;                                            // Current speed, see speed Effect
  398.     short                    finespeed;                                        // Current finespeed, see speed Effect
  399.     short                    InstruTube[ MAXINSTRU];                            // Used in 'Instrument View' Window - View menu
  400.     short                    VExt;                                            // External music speed, see 'Adaptators' window. 80 = normal
  401.     short                    FreqExt;                                        // External music pitch, see 'Adaptators' window. 80 = normal
  402.     Boolean                    Reading;                                        // Reading indicator
  403.     short                    LeftRight[ MAXTRACK];                            // Left/Right % for Deluxe Driver
  404.  
  405.     #ifdef _MAC_H
  406.     SndChannelPtr             MusicChannelPP;                                    // The SndChannelPtr to apply SndDoCommand, etc.
  407.     #endif                                                                    // ONLY available if you are using MAC SoundManager driver
  408.     
  409.     #ifdef _INTEL_H
  410.     LPDIRECTSOUND            lpDirectSound;                                    // The LPDIRECTSOUND to apply & get informations, etc.
  411.     LPDIRECTSOUNDBUFFER        lpDirectSoundBuffer, lpSwSamp;                    // ONLY available if you are using Win95 DirectSound driver
  412.     #endif    
  413.  
  414.     /** Private variables - Not documented **/
  415.     /* DO NOT MODIFY OR USE these variables */
  416.  
  417.     long                    MIN_PITCH, MAX_PITCH;
  418.     short                    smallcounter, trackDiv;
  419.     long                    FREQBASE;
  420.     short                    InstruActif[ MAXINSTRU];
  421.     Ptr                        SysHeapPtr, Vol, IntDataPtr, OscilloWavePtr;
  422.     Boolean                    JumpToNextPattern, endPattern, MADPlay;
  423.     long                    ASCBUFFER;
  424.     long                    BufSize;
  425.     long                    VSYNC, BufCounter, BytesToGenerate;
  426.     short                    vibrato_table[ 64];
  427.     short                    MIDIPortRefNum, gOutNodeRefNum;
  428.     short                    InstuNoOld[ MAXTRACK];
  429.     short                    NoteOld[ MAXTRACK];
  430.     short                    VelocityOld[ MAXTRACK];
  431.     Boolean                    TrackLineReading[ MAXTRACK];
  432.     Ptr                        OverShoot;
  433.     long                    *DASCBuffer;
  434.     short                    *DASCBuffer8;
  435.     long                    MDelay;
  436.     long                    RDelay;
  437.     Ptr                        ReverbPtr;
  438.     
  439.     #ifdef _MAC_H
  440.     SndDoubleBufferHeader     TheHeader;
  441.     SndChannelPtr             pseudoChanAWAC;
  442.     inVBLRec                VBL;
  443.     #endif
  444. };
  445. typedef struct MADDriverRec MADDriverRec;
  446.  
  447. /********************                        ***********************/
  448. /***                        EFFECTS ID                            ***/
  449. /********************                        ***********************/
  450.  
  451. enum {
  452.         arpeggioE         = 0,    //    0x00
  453.         downslideE         = 1,    //    0x01
  454.         upslideE         = 2,    //    0x02
  455.         portamentoE     = 3,    //    0x03
  456.         vibratoE         = 4,    //    0x04
  457.         portaslideE     = 5,    //    0x05
  458.         vibratoslideE    = 6,    //    0x06
  459.         nothingE         = 7,    //    0x07
  460.         offsetE         = 9,    //    0x08
  461.         slidevolE         = 10,    //    0x0A
  462.         fastskipE         = 11,    //    0x0B
  463.         volumeE         = 12,    //    0x0C
  464.         skipE             = 13,    //    0x0D
  465.         extendedE         = 14,    //    0x0E
  466.         speedE             = 15    //    0x0F
  467.     };
  468.  
  469. /********************                        ***********************/
  470. /***                        FUNCTIONS                            ***/
  471. /********************                        ***********************/
  472.  
  473.  
  474. #ifdef __cplusplus
  475. extern "C" {
  476. #endif
  477.  
  478. MADLibrary* MADGetMADLibraryPtr();                                    // Get MADDriver structure pointer.
  479.  
  480. OSErr    MADInitLibrary( char *PlugsFolderName, Boolean SysMemory);    // Library initialisation, you have to CALL this function if you want to use other functions & variables
  481. OSErr    MADDisposeLibrary( void);                                    // Close Library, close music, close driver, free all memory
  482.  
  483. void    MADGetBestDriver( MADDriverSettings    *DriverInitParam);        // Found and identify the current Mac sound hardware and fill DriverInitParam
  484. OSErr    MADCreateDriver( MADDriverSettings    *DriverInitParam, MADDriverRec** returnDriver);        // Music Driver initialization and memory allocation
  485. OSErr    MADDisposeDriver( MADDriverRec *MDriver);                                            // Dispose the music driver, use it after RInitMusic()
  486.  
  487. OSErr    MADChangeDriverSettings( MADDriverSettings    *DriverInitParam, MADDriverRec** returnDriver);
  488.  
  489. OSErr    MADStartDriver( MADDriverRec *MDriver);                                        // NEW - Activate the sound generating procedure (interruption)
  490. OSErr    MADStopDriver( MADDriverRec *MDriver);                                        // NEW - DESActivate the sound generating procedure (interruption)
  491.  
  492. OSErr    MADPlayMusic( MADDriverRec *MDriver);                                                // NEW - Read and play current music in memory - Call MADStartInterruption BEFORE
  493. OSErr    MADStopMusic( MADDriverRec *MDriver);                                                // NEW - Stop reading current music in memory
  494.  
  495. OSErr    MADReset( MADDriverRec *MDriver);                                            // Reset the current music at the start position
  496. OSErr    MADGetMusicStatus( MADDriverRec *MDriver, long *fullTime, long *curTime);            // Get informations about music position and duration, IN 1/60th SECS !! NOT IN SECS ANYMORE !!!!!!!
  497. OSErr    MADSetMusicStatus( MADDriverRec *MDriver, long minV, long maxV, long curV);            // Change position of current music, by example MADSetMusicStatus( 0, 100, 50) = go to the middle of the music
  498.  
  499. OSErr    MADSetHardwareVolume( long);                                // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  500. long    MADGetHardwareVolume( void);                                        // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  501.  
  502. OSErr    MADAttachDriverToMusic( MADDriverRec *driver, MADMusic *music);
  503.  
  504. OSErr    MADLoadMusicRsrc( MADMusic **music, OSType IDName, short IDNo);                // MADH ONLY - Load a MAD Rsrc into memory
  505. OSErr    MADLoadMusicPtr( MADMusic **music, Ptr myPtr);                                // MADH ONLY - Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call
  506.  
  507. OSErr    MADLoadMusicFilePString( MADMusic **music, char *type, Str255 fName);            // Load a music file with plugs
  508. OSErr    MADLoadMusicFileCString( MADMusic **music, char *type, Ptr fName);            // Load a music file with plugs
  509. OSErr    MADLoadMusicFSpFile( MADMusic **music, char *type, FSSpec *theSpec);            // Load a music file with plugs
  510.  
  511. OSErr    MADMusicIdentifyPString( char *type, Str255 pName);            // Identify what kind of music format is pName file.
  512. OSErr    MADMusicIdentifyCString( char *type, Ptr cName);            // Identify what kind of music format is cName file.
  513. OSErr    MADMusicIdentifyFSp( char *type, FSSpec *theSpec);            // Identify what kind of music format is theSpec file.
  514.  
  515. Boolean    MADPlugAvailable( char *type);                                // Is plug 'type' available?
  516.  
  517. OSErr    MADDisposeMusic( MADMusic **);                                // Dispose the current music, use it after RLoadMusic(), RLoadMusicRsrc(), RInstallMADF()
  518.  
  519. void    MADChangeTracks( MADDriverRec *MDriver, short);                // Change current tracks number of the music driver
  520. void    MADCleanDriver( MADDriverRec *intDriver);                    // Clean the driver : stop playing sounds
  521. Cmd*    GetMADCommand(    short        position,                        // Extract a Command from a PatData structure
  522.                         short        channel,
  523.                         PatData*    aPatData);
  524.  
  525. OSErr    MADPlaySndHandle(     MADDriverRec *MDriver,
  526.                             Handle sound,                            // Handle to a 'snd ' handle, by ex: GetResource('snd ', 128);
  527.                             long chan,                                // channel ID on which to play sound
  528.                             long note);                                // note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz
  529.  
  530. OSErr    MADPlaySoundData(    MADDriverRec *MDriver,
  531.                             Ptr                soundPtr,                // Sound Pointer to data
  532.                             long            size,                    // Sound size in bytes
  533.                             long            channel,                // channel ID on which to play sound
  534.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  535.                             long            amplitude,                // 8 or 16 bits
  536.                             long            loopBeg,                // loop beginning
  537.                             long            loopSize,                // loop size in bytes
  538.                             unsigned long    rate);                    // sample rate of the sound data, by ex: rate22khz
  539.  
  540. OSErr    MADPlaySoundDataSYNC(MADDriverRec *MDriver,
  541.                             Ptr                soundPtr,                // Sound Pointer to data
  542.                             long            size,                    // Sound size in bytes
  543.                             long            channel,                // channel ID on which to play sound
  544.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  545.                             long            amplitude,                // 8 or 16 bits
  546.                             long            loopBeg,                // loop beginning
  547.                             long            loopSize,                // loop size in bytes
  548.                             unsigned long    rate);                    // sample rate of the sound data, by ex: rate22khz
  549.  
  550. Ptr MADNewPtr( long size, MADLibrary* init);
  551. Ptr MADNewPtrClear( long size, MADLibrary* init);
  552.  
  553. #ifdef __cplusplus
  554. }
  555. #endif
  556.  
  557. #if defined(powerc) || defined (__powerc)
  558. #pragma options align=reset
  559. #else
  560. #if !defined(THINK_C)
  561. #pragma options align=reset
  562. #endif
  563. #endif
  564. #endif